package com.czd.support.service;

import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.common.Configuration;
import com.czd.support.model.FeedBack;

@Service
public class FeedBackService extends BaseService<FeedBack> {
	
	public Paginate queryForPaginate(FeedBack feedBack){
		feedBack.setPageSize(Configuration.getInstance().getDefault_page_size());
        return this.queryForPaginate(sqlId("select"), feedBack);
    }
	
	public boolean insert(FeedBack feedBack){
		if(this.insertAndReturnId(sqlId("insert"), feedBack) >0){
			return true;
		}
		else{
			return false;
		}
	}
	
	public FeedBack findById(int id) {
        return this.selectOne(sqlId("findFeedBackById"),id);
    }
	
	public boolean delete(FeedBack feedBack) {
        return this.delete(sqlId("delete"),feedBack);
    }
	
	public boolean update(FeedBack feedBack) {
        return this.update(sqlId("update"),feedBack);
    }

}
